feat(dashboard): hide Sponsorship until there is an enquiry - #371
feat(dashboard): hide Sponsorship until there is an enquiry#371harshtandiya wants to merge 1 commit into
Conversation
❌ UI Demo Check failedThis pull request changes the UI (2 file(s) under 🛠️ How to fix
Either one re-runs this check automatically. |
Greptile SummaryThe PR conditionally shows the management sidebar’s Sponsorship entry when the current user has at least one enquiry.
Confidence Score: 4/5The application change appears sound, but the persistent-state-dependent browser test should be fixed before merging because valid Administrator enquiry data can fail the workflow. The new test requires the shared Administrator account to have no sponsorship enquiries, yet its setup does not establish or clean that state; a retained enquiry correctly renders the link and breaks the assertion. Files Needing Attention: e2e/tests/manage-access.spec.ts
|
| Filename | Overview |
|---|---|
| dashboard/src/data/sponsorships.ts | Adds the uncached, user-scoped enquiry request used to determine sidebar visibility. |
| dashboard/src/layouts/ManagerLayout.vue | Makes personal navigation reactive and includes Sponsorship only when the enquiry response contains rows. |
| e2e/tests/manage-access.spec.ts | Preserves direct placeholder-route coverage, but the new absence assertion still depends on unarranged persistent Administrator data. |
Reviews (4): Last reviewed commit: "feat(dashboard): hide Sponsorship until ..." | Re-trigger Greptile
| await expect(page.getByRole("link", { name: "Talk Proposals" })).toBeVisible({ | ||
| timeout: 15000, | ||
| }); | ||
| await expect(page.getByRole("link", { name: "Sponsorship" })).toHaveCount(0); |
There was a problem hiding this comment.
Test assumes empty sponsorship state
This assertion relies on the shared Administrator account having no sponsorship enquiries, but the persistent test database has no setup or cleanup that establishes that state. A retained Administrator-owned enquiry correctly renders the link and makes this test fail despite valid product behavior.
Knowledge Base Used: Browser-Level E2E Test Harness
Prompt To Fix With AI
This is a comment left during a code review.
Path: e2e/tests/manage-access.spec.ts
Line: 26
Comment:
**Test assumes empty sponsorship state**
This assertion relies on the shared Administrator account having no sponsorship enquiries, but the persistent test database has no setup or cleanup that establishes that state. A retained Administrator-owned enquiry correctly renders the link and makes this test fail despite valid product behavior.
**Knowledge Base Used:** [Browser-Level E2E Test Harness](https://app.greptile.com/bwh-tech/-/custom-context/knowledge-base/bwhtech/buzz/-/docs/e2e-test-harness.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
bdb5ba2 to
d33d98a
Compare
7463e7e to
14b0dd6
Compare
d33d98a to
ee0730e
Compare
14b0dd6 to
53eecac
Compare
The manage sidebar showed Sponsorship to everyone, though the section only has something to say once a user has filed an enquiry. Follow the account tabs and read the same endpoint, dropping the item when it comes back empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ee0730e to
d881152
Compare
53eecac to
3353f4d
Compare
The manage sidebar listed Sponsorship for everyone, but the section only has
anything to show once a user has filed an enquiry. The account tabs already
gate their Sponsorships tab on
get_user_sponsorship_inquiries; the sidebarnow reads the same endpoint and drops the item when it comes back empty.
dashboard/src/data/sponsorships.ts—useMySponsorships(), v2useCall,no
cacheKey(it persists to IndexedDB and would outlive the session).ManagerLayout.vue—personalItemsis a computed; the Sponsorship entryis spread in only when the call returns rows.
Gotchas:
/manage/sponsorshipstill resolves to the work-in-progress placeholder foranyone who types it. Hiding the item is the ask; a redirect can wait until
the section has a real page.
Administrator no longer sees. It now navigates directly, and a second test
asserts the item is absent.
Not changed: the account tabs, the endpoint, or the placeholder route.